export function paginationTool(
  data: API.Pagination,
  total: number,
  callback?: (data: API.Pagination) => void,
) {
  return {
    onChange: (page: number, pageSize?: number) => {
      if (callback) {
        callback({ page:page, pageSize: pageSize??10 });
      }
    },
    current: data?.page,
    pageSize: data?.pageSize,
    total: total,
    showTotal: () => {
      return `全部 ${total}`;
    },
    showQuickJumper: true,
    showSizeChanger: true,
  };
}
export function defaultPagination() {
  return {
    page: 1,
    pageSize: 10,
  };
}
